import Vue from 'vue'
import axios from 'axios'

import App from './App'
import router from './router'

import MuseUI from 'muse-ui'
import 'muse-ui/dist/muse-ui.css'
import 'material-design-icons/iconfont/material-icons.css'
import 'font-awesome/scss/font-awesome.scss'
Vue.use(MuseUI)

import Toast from 'muse-ui-toast/dist/muse-ui-toast.esm'
let toastOption = {
  position: 'top',                  // position
  time: 500,                        // show time length
  closeIcon: 'close',               // close icon
  close: true,                      // show close button
  successIcon: 'check_circle',      // success icon
  infoIcon: 'info',                 // info icon
  warningIcon: 'priority_high',     // warning icon
  errorIcon: 'warning'              // error icon
};
Vue.use(Toast, toastOption)

import {Upload} from 'element-ui';
import {Drawer} from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(Upload);
Vue.use(Drawer);

import db from '../main/datastore'
Vue.prototype.$db = db

import getIP from '../main/network'
Vue.prototype.$getIP = getIP;

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  components: { App },
  router,
  template: '<App/>'
}).$mount('#app')
